﻿
<!--<If:Empty>-->
<p>没有找到您要找的文章</p>
<!--</If:Empty>-->

<!--<IfNot:Empty>-->
<div id="ArticleDetail">
    <h1>
        <span class="Title">{Title}</span>
        <span class="DateCreated">({DateCreated})</span>
    </h1>
    <div class="Summary">
        <pre>{Summary}</pre>
    </div>
    <div class="Content">
        <pre>{Content}</pre>
    </div>
    <div class="Author">
        {Author}
    </div>
</div>


<!--<If:Maintain>-->
<form id="FrmUpdateArticle" method="post" action="{RootUrl}/_Ajax/blog.aspx?op=UpdateArticle">        
    <h1 class="showHiddenForm hd">编辑</h1>
    <h1 class="hideHiddenForm hd" style="display:none">编辑()</h1>
    <div class="hiddenForm bd">
        <input type="hidden" name="Id" value="{Id}" />
        <ul>
            <li>
                <label>Title:</label><input type="text" name="Title" value="{Title}" class="input-field" />
            </li>
            <li>
                <label>Content:</label><textarea name="Content"  class="textarea-content">{Content}</textarea>
            </li>
            <li>
                <label>Summary:</label><textarea name="Summary" class="textarea-summary">{Summary}</textarea>
            </li>
            <li>
                <label>Author:</label><input type="text" name="Author" value="{Author}" />
            </li>
            <li>
                <label>IsOriginal:</label><select name="IsOriginal"><option value="true">是</option><option value="false" {OriginalSelected}>否</option></select>
            </li>
            <li>
                <label>IsPublished:</label><select name="IsPublished"><option value="true">是</option><option value="false" {PublishedSelected}>否</option></select>
            </li>
            <li>
                <label>&nbsp;</label><button>修改</button>
            </li>
        </ul>
    </div>
</form>

<script type="text/javascript">
$(function(){
    $("#FrmUpdateArticle").ajaxSubmit( function(dat,fields){
        $('body').alert(dat.success||dat.failure||"")
        if( dat.success ){
            var artDetail = $('#ArticleDetail');
            artDetail.find('.Title').html( fields.Title);
            artDetail.find('.DateCreated').html( fields.DateCreated);
            artDetail.find('.Summary').html( fields.Summary );
            artDetail.find('.Content').html( fields.Content );
            artDetail.find('.Author').html( fields.Author );
        }
    });
});

</script>
<!--</If:Maintain>-->
<!--</IfNot:Empty>-->